package com.bj58.mis.apm.server.core.util;

import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.Map;

/**
 * @Author: wangxw
 * @Date: 2018/7/24 10:29
 */
@Component
@Scope("prototype")
public class WOSClientThread implements Runnable{

    @Resource
    private WOSClient wosClient;

    private Map<String, String> output;

    public WOSClientThread(){
    }

    public WOSClientThread setOutput(String fileName, String context){
        output = new HashMap<>();
        output.put("fileName", fileName);
        output.put("context", context);
        return this;
    }
    @Override
    public void run() {
        wosClient.uploadFile(output.get("fileName"), output.get("context"));
    }
}
